﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

public partial class Index : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!object.Equals(Session["UserName"], null))
        {
            this.HaveLogin.Visible = true;
            this.NoLogin.Visible = false;
            this.LinkButton3.Text = Session["UserName"].ToString();
        }
            
        else
        {
            this.HaveLogin.Visible = false; ;
            this.NoLogin.Visible = true;
        }
    }
    // 登陆
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Response.Redirect("UserCenter/user_Login.aspx");
    }
    // 注册
    protected void LinkButton2_Click(object sender, EventArgs e)
    {
        Response.Redirect("registe.aspx");
    }
    // 用户中心
    protected void LinkButton3_Click(object sender, EventArgs e)
    {
        
        Response.Redirect("UserCenter/userCenter.aspx");
        form1.Target = "_blank";
        //Response.Write("<script>window.open('UserCenter/userCenter.aspx','_blank');</script>"); 
    }
    // 退出
    protected void LinkButton4_Click(object sender, EventArgs e)
    {
        Session["UserName"] = null;
        Response.Redirect("~/Default.aspx");
    }
}
